// pages/index/index.js
var local = require("../../data/local");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgUrl:[
      {src:"/images/01.jpg",id:0},
      {src:"/images/02.jpg",id:1},
      {src:"/images/03.jpg",id:2}
  ],
  postList:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
    var postList = local.postList;
    this.setData({
      postList
    });
    console.log(this.data)
  },
  handleClick(event){
    var id = event.currentTarget.dataset.id;
    wx.navigateTo({
      url: 'details/details?id='+id
    })
  },
  jump(event){
    var id = event.currentTarget.dataset.id;
    wx.navigateTo({
    url: '/pages/index/details/details?id='+id
    })
  }
})
